package com.web.wechat.global.controller;

import com.blue.core.dict.HttpMethod;
import com.blue.core.dict.annotation.DictParser;
import com.blue.http.annotation.Http;
import com.blue.http.message.HttpRequest;
import com.blue.http.message.View;
import com.web.core.util.Const;
import com.web.wechat.global.model.User;
import com.web.wechat.global.util.HttpContext;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

@Controller
@Http(url = "/index")
public class IndexController
{
	@Resource
	private HttpContext httpContext;
	
	private DictParser dictParser = DictParser.getInstance();
	
	public IndexController()
	{
	}
	
	@Http(url = "", method = HttpMethod.GET)
	public View index(HttpRequest request)
	{
		User user = httpContext.getUser(request);
		return View.createBuilder().setView("/index/index")
				.put(Const.FTL_TITLE, "主页")
				.build();
	}
	
}
